package com.ad.pet.app.mall.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.models.remote.cart.ShippingWay;

import java.util.List;

/**
 * Created by SEELE on 2019/7/12.
 */

public class ShipAdater extends BaseQuickAdapter<ShippingWay,BaseViewHolder> {
    public ShipAdater( @Nullable List<ShippingWay> data) {
        super(R.layout.item_mall_shiping_way, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShippingWay item) {

        TextView tvShip = helper.getView(R.id.tv_ship_way);
        ImageView imageView = helper.getView(R.id.iv_ship);
        TextView tvTime =  helper.getView(R.id.tv_time);
        TextView tvMoney = helper.getView(R.id.tv_fee);
        if (helper.getLayoutPosition()==0){
            imageView.setVisibility(View.VISIBLE);
        }else {
            imageView.setVisibility(View.INVISIBLE);
        }
        tvShip.setText(item.getName());
        tvMoney.setText(item.getFreight_txt());
        tvTime.setText(item.getDelivery_time());
    }
}
